package com.xq.shop.service.user.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xq.shop.dao.IBaseDAO;
import com.xq.shop.dao.ICartGoodDAO;
import com.xq.shop.po.CartGood;
import com.xq.shop.service.user.ICartGoodService;

@Service("user_cartGood_service")
public class CartGoodService extends BaseService<CartGood> implements ICartGoodService  {

	@Autowired
	private ICartGoodDAO cartGoodDAO;
	
	@Override
	public IBaseDAO<CartGood> getDAO() {
		return cartGoodDAO;
	}
	
	@Override
	public List<CartGood> getByUID(Long userId) {
		return cartGoodDAO.getByUID(userId);
	}

	@Override
	public CartGood get(Long userId, Long productId) {
		return cartGoodDAO.get(userId, productId);
	}

	@Override
	public void delete(Long id, Long userId) throws Exception {
		cartGoodDAO.delete(id, userId);
	}
	
	public void delete(Long userId, Long[] productId){
		cartGoodDAO.delete(userId, productId);
	}
}
